Crate supports_unicode

source ·
Expand description

Detects whether a terminal supports unicode.

This crate is a Rust port mashing together @sindresorhusis-unicode-supported and @iarna’s has-unicode NPM packages.

§Example

use supports_unicode::Stream;

if supports_unicode::on(Stream::Stdout) {
    println!("stdout supports unicode output");
} else {
    println!("no unicode, please");
}

§MSRV

This crate requires rustc 1.70.0 or later.

Enums§

Functions§

  • Returns true if stream is a TTY or the current terminal supports_unicode.
  • Returns true if the current terminal, detected through various environment variables, is known to support unicode rendering.